<%--
  Created by IntelliJ IDEA.
  User: Colorful
  Date: 2023/8/10
  Time: 11:06
  To change this template use File | Settings | File Templates.
--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath }"/>
<script rel="script" src="${path}/js/jquery-3.6.4.js"></script>
<link rel="stylesheet" type="text/css" href="${path}/css/user.css">
<style>
    *{
        margin: 0px;
        padding: 0px;
    }
    /*主大菜单*/
    .content{
        width: 1200px;
        height: 650px;
        margin: 0px auto;
        margin-top: 50px;
    }
    .main{
        border: 1px solid #e1e1e1;
        position: relative;
    }
    /*左侧*/
    .user-profile-nav{
        position: absolute;
        top: 0;
        bottom: 0;
        width: 200px;
        background-color: #f4f3f4;
        text-align: center;
        border-right: 1px solid #e1e1e1;
        width: 200px;
        height: 650px;
    }
    .user-profile-nav h1{
        margin-top: 40px;
        margin-bottom: 30px;
        font-size: 22px;
        color: #222;
        font-weight: 400;
    }
    .user-profile-nav a {
        display: block;
        font-weight: 400;
        color: #333;
        height: 40px;
        width: 202px;
        margin-left: -1px;
        line-height: 40px;
        font-size: 18px;

    }
    .user-profile-nav a:active {
        color: #fff;
        background-color: #ed3931;
        text-decoration: none;
    }
    .user-profile-nav a:hover {
        text-decoration: none;
    }
    /********************************************************************/
    /*右侧iframe框架*/
    .detail{
        height: 650px;
        width: 950px;
        float: right;
    }
</style>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%--    前端用户--%>
<%@include file="header.jsp"%>
<div class="content">
    <div class="main">
        <div class="user-profile-nav">
            <h1>个人中心</h1>
            <a class="userBack" style="background-color: #ef4238" onclick="changes('userOrderDetail',this)">我的订单</a>
            <a class="userBack" onclick="changes('userProfile',this)">基本信息</a>
            <a class="userBack" onclick="changes('userComments',this)">我的评论</a>
            <a class="userBack" onclick="jQuery:window.location='../login.jsp'">退出登录</a>
        </div>
        <iframe class="detail" width="900px" height="900px" src="userOrderDetail.jsp"></iframe>
    </div>
</div>
<%@include file="footer.jsp"%>
<script>
    function backChanges() {
        var back=$(".userBack");//获取所有class为item的元素
        for(var j = 0; j < back.length; j++){  //遍历所有的li元素。
            // if(j != this.index){  //将除了点击的li元素外的元素的背景变为白色。
                back[j].style.background = '#f4f3f4';
            // }
        }
    }
    function changes(path,a) {
        backChanges();
        $(".detail").attr("src",path+".jsp");
        $(a).css("background-color","#ef4238");
    }
</script>